package com.example.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.alibaba.fastjson.JSONObject;
import com.example.bean.Home;
import com.example.config.UrlsConfig;
import com.example.fruit.AllGuoSHiActivity;
import com.example.fruit.BroadGuoSHiActivity;
import com.example.fruit.ChinaGuoSHiActivity;
import com.example.fruit.GiftGuoSHiActivity;
import com.example.fruit.R;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest;


public class CategoryFragment extends BaseFragment {

    private HttpUtils httpUtils;
    private Home home;

    private RelativeLayout rLayout1,rLayout2,rLayout3,rLayout4;
    private View view;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        httpUtils=new HttpUtils();



    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

               view  =inflater
                        .inflate(R.layout.fragment_category,
                                container, false);
        initView();
        return view;
    }

    private void initView() {
        rLayout1=(RelativeLayout)view.findViewById(R.id.allGuoShi);
        rLayout2=(RelativeLayout)view.findViewById(R.id.broadGuoShi);
        rLayout3=(RelativeLayout)view.findViewById(R.id.ChinaGuoShi);
        rLayout4=(RelativeLayout)view.findViewById(R.id.giftGuoShi);
        rLayout1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent1=new Intent(getActivity(), AllGuoSHiActivity.class);
                startActivity(intent1);
            }
        });
        rLayout2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent2=new Intent(getActivity(),BroadGuoSHiActivity.class);
                startActivity(intent2);
            }
        });
        rLayout3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent3 = new Intent(getActivity(),ChinaGuoSHiActivity.class);
                startActivity(intent3);
            }
        });
        rLayout4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent4=new Intent(getActivity(),GiftGuoSHiActivity.class);
                startActivity(intent4);
            }
        });

    }


    }


